package client.vue;

import java.awt.CardLayout;
import java.awt.Dimension;
import java.awt.Image;
import java.awt.Toolkit;
import java.rmi.NotBoundException;
import java.rmi.RemoteException;
import java.util.Observable;
import java.util.Observer;

import javax.swing.JFrame;
import javax.swing.JPanel;

import codebase.IPartie;

public class Vue extends JFrame implements Observer {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	public final static CardLayout layout = new CardLayout();
	public static JPanel panelPrincipal = new JPanel(layout);
	public static IPartie partie;

	public Vue() throws RemoteException, NotBoundException {
		setSize(new Dimension(1366, 768));
		setTitle("Diplomacy");
		setUndecorated(true);
		Image icone = Toolkit.getDefaultToolkit()
				.getImage("./src/client/images/diplomacy_logo.png");
		setIconImage(icone);
		panelPrincipal.add(new Accueil(), "Accueil");
		// panelPrincipal.add(new CreerPartieReseau(partie),
		// "CreerPartieReseau");
		// panelPrincipal.add(new Jeu(partie), "Jeu");
		layout.first(panelPrincipal);
		add(panelPrincipal);

		pack();
	}

	@Override
	public void update(Observable arg0, Object arg1) {
		// TODO Auto-generated method stub
	}

	public static void changeFenetre(String nomFenetre) {
		layout.show(panelPrincipal, nomFenetre);
	}

}
